devspiffy
Devspiffy
48 posts
Developer Notes for the future & Other Stories
Don't wanna be here? Send us removal request.
devspiffy · 7 years ago
Text
error: refs/heads/development does not point to a valid object!
just, 
create a new branch from you damage branch, delete your local development* checkout and create a new development branch or other valid branch git fetch & pull, then.. comeback to you damage branch and git fetch & pull .. 
done .. fun easy
0 notes
devspiffy · 7 years ago
Text
the vsc (visual studio code) and the naive developer fable.
so there was a freak developer who likes to install all posible available extensions for vsc then he run into app frozen case every time he opens his vsc , so he was dying and feeling so terribly wrong and regretting about his behavior so he decided to run this code ~/.vscode/extensions and erase everything inside. 
and he was happy til next commit .. 
0 notes
devspiffy · 8 years ago
Text
Dudes!, I have created my first pod
don't hesitate to download it
https://cocoapods.org/pods/XRoundImage
https://github.com/abundis29/XRoundImages
you can do this beautiful rounded images with or without borders, even change border color,
how to -> https://youtu.be/A6GJkHl5Q8M
Tumblr media
0 notes
devspiffy · 8 years ago
Link
this is mucho bueno, 
read it! then go fuck yourself :)
happydev! 
0 notes
devspiffy · 8 years ago
Text
AlamoFire , TimeOut, Swift 3
If you are using Alamofire below is the code to define timeout
let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() configuration.timeoutIntervalForRequest = 10 // seconds configuration.timeoutIntervalForResource = 10 self.alamoFireManager = Alamofire.Manager(configuration: configuration)
also you don't need to manage it through timer, as timer will fire exactly after 10 seconds, irrelevant whether your API get response or not, just manage it with timeout.
and here is how you manage timeout
self.alamofireManager!.request(.POST, "myURL", parameters:params) .responseJSON { response in    switch response.result {        case .Success(let JSON):            //do json stuff        case .Failure(let error):            if error._code == NSURLErrorTimedOut {               //call your function here for timeout            }     } }
0 notes
devspiffy · 8 years ago
Text
responseSerializationFailed, AlamoFire Swift 3 error?
Try using responseString, responseData or response
:)
0 notes
devspiffy · 8 years ago
Text
use html from json angular2
In Angular2 you can use property binding to access properties of DOM elements, in your case:
<div [innerHTML]="post.body"></div>
0 notes
devspiffy · 8 years ago
Text
this is gold!, query parameters
query parameters from ActivatedRoute.
To receive them, you could put them into your component's OnInit function like this:
private accesstoken; private code; constructor(private route: ActivatedRoute) { } ngOnInit() {  // Capture the access token and code  this.route      .queryParams      .subscribe(params => {          this.accesstoken = params['#access_token'];          this.code = params['code'];      });  // do something with this.code and this.accesstoken }
There's more examples in the link I put above. You may have problems with angular because the router also identifies fragments, which start with the #... If angular does identify it as a fragment, then you can just subscribe to the fragment observable from ActivatedRoute and do it that way.
I'm not sure if you're being redirected. If you are, the could look into using the preserveQueryParams navigation option, something like this.
this.router.navigate([redirect], {preserveQueryParams: true});
0 notes
devspiffy · 8 years ago
Text
Cocoapods + Cannot load underlying module for 'x'
just, 
cmd + B 
build :)
have fun!
0 notes
devspiffy · 8 years ago
Text
how to update node! npm! and be cool in just a line.
npm install npm@latest -g
0 notes
devspiffy · 8 years ago
Text
Boilerplates FOR android
https://github.com/ribot/android-boilerplate
https://github.com/hitherejoe/Android-Boilerplate this one looks better cuz it have the death star logo.
https://github.com/mutexkid/andengine-androidstudio, they say “this will work out of the box...”
http://www.androidbootstrap.com/
https://github.com/dmilicic/Android-Clean-Boilerplate
http://androidkickstartr.com/
i’m testing this.. in few days i’ll post the best for me and why.  
0 notes
devspiffy · 8 years ago
Text
First time dotnet core installation in OSx MacOx
don’t forget:
you need BREW (homebrew)
brew update
brew install openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
https://www.microsoft.com/net/core#macos
0 notes
devspiffy · 8 years ago
Text
Notes: Redux
Tumblr media
What is redux? 
Provides predicable state management using actions and reducers. (for JavaScript apps)
Actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using store.dispatch(); Also describes something has (or should)happen, but they don’t specify how it should be done. 
Reducers  A pure function that takes the previos state and an action and returns the new state,  how the application's state changes in response. This is the job of reducers.
Reducers handle state transition, but the must be done synchronously
this document will return ... 
0 notes
devspiffy · 8 years ago
Text
#git How do I get my 'Detached HEAD' commits back into master [duplicate] or Ghost commit.
f checkout master was the last thing you did, then the reflog entry HEAD@{1} will contain your commits (otherwise use git reflog or git log -p to find them). Use git merge HEAD@{1} to fast forward them into master.
EDIT:
As noted in the comments, Git Ready has a great article on this.
Tumblr media
git reflog and gitreflog --all will give you the commit hashes of the mis-placed commits.
Source: http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html
0 notes
devspiffy · 8 years ago
Text
Installing ngrok on OSX
Download ngrok
Unzip it to your Applications directory
Create a symlink (instructions below)
Creating a symlink to ngrok
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory cd /usr/local/bin # create symlink ln -s /Applications/ngrok ngrok
This will allow you to run the ngrok command from any directory while in the terminal. Without the symlink, you would need to either cd into the Applications directory (or wherever you installed the executable) or reference ngrok with its full path every time (e.g. /Applications/ngrok 5000)
Using ngrok
The easiest way to use ngrok to tunnel into your localhost is if your local project is running on a specific port (e.g. not using named vhosts). You just run ngrok http [port number].
You can quickly boot up a local webserver using ruby. cd into the project's root directory and run ruby -run -e httpd . -p [port number].
0 notes
devspiffy · 8 years ago
Text
#git Stash & Apply in other (new)branch
just, 
git stash pop
0 notes
devspiffy · 8 years ago
Text
#maybe
login: cthulhu password: ****** # sudo universe -G 6.672e-11 -e 1.602e-19 -h 6.626e-34 -protonmass 1.673e-27
0 notes