Skip to content

Instantly share code, notes, and snippets.

View jonajgs's full-sized avatar
😎
programming

Jonathan jonajgs

😎
programming
  • Guadalajara
View GitHub Profile
export default function(state = initialState, action) {
const index = state.tasks.findIndex(task => task.id === action.taskId);
switch (action.type) {
case CREATE_TASK:
return {
...state,
lastCreated: state.lastCreated + 1,
tasks: [
...state.tasks,
...[{
@jonajgs
jonajgs / how get Headers angular with http
Created April 13, 2018 15:12
how get the header's token
this.http.get(this._url, {search: params}).map((res: Response) => {
if(res.headers && res.headers.get('Token')) {
var token = res.headers.get('Token');
}
return res.json()
}).catch(function(error) {
return Observable.throw(error.json());
});
server {
listen 80;
server_name server.com;
location / {
root /public/path/;
index index.html index.htm index.php;
}
location ~ \.php$ {
@jonajgs
jonajgs / web.config
Created March 13, 2017 18:39 — forked from allebb/web.config
Laravel 5.x web.config file for Windows Azure hosting
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
@jonajgs
jonajgs / equals.js
Last active November 7, 2016 02:46
equals: (obj1, obj2) => {
let obj1Props = Object.getOwnPropertyNames(obj1);
let obj2Props = Object.getOwnPropertyNames(obj2);
if (obj1Props.length != obj2Props.length) {
return false;
}
obj1Props.map(op => {
if ( obj1[op] !== obj2[op] ) {
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'