Skip to content

Instantly share code, notes, and snippets.

View ProgressiveTilemap.as
package com.abeltoy.utils
{
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.utils.getTimer;
import net.flashpunk.FP;
import net.flashpunk.Graphic;
/**
View Parser
----------
Product parser
-------------
The parser only needs an URL to work. The main class is called **Parser** and any site specific parser extends this main class and overrides specific functions to make it work on that specific site.
#### **General process**
View keybase.md

Keybase proof

I hereby claim:

  • I am andrepcg on github.
  • I am andrepcg (https://keybase.io/andrepcg) on keybase.
  • I have a public key whose fingerprint is 7D21 53CB 44CF FD5A AEC4 E000 B217 E0F3 3265 B6B1

To claim this, I am signing this object:

@andrepcg
andrepcg / 0_reuse_code.js
Created Oct 20, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View dlib and face_recognition on raspberry pi.md

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@andrepcg
andrepcg / shipitfile.js
Created Jan 20, 2018 — forked from jbraithwaite/shipitfile.js
Shipit deploy with Slack integration
View shipitfile.js
var pack = require('./package.json');
var request = require('request');
var name = pack.name;
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
var deployTo = '/var/www/FOLDER_TO_DEPLOY_TO';
var deployToCurrent = deployTo + '/current';
var slackWebhookURL = 'SLACK_HOOK_URL';
View keybase.md

Keybase proof

I hereby claim:

  • I am andrepcg on github.
  • I am andrepcg (https://keybase.io/andrepcg) on keybase.
  • I have a public key whose fingerprint is BA4A F148 669B D4D3 B8E0 B1EA 2B73 D827 47E0 DBE4

To claim this, I am signing this object:

View react.memo.js
const Product = React.memo((props) => {
const { name, price } = props;
return (
<div className="product-info">
<span>{name}</span>
<span>{price}</span>
</div>
);
});
View useCounter.js
import React, { useState } from "react";
const useCounter = (initialValue) => {
const [count, setCount] = useState(initialValue);
const increment = () => setCount(count + 1);
const decrement = () => setCount(count - 1);
return { count, increment, decrement };
};
function Counter() {