Skip to content

Instantly share code, notes, and snippets.

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;
/**
@andrepcg
andrepcg / Parser
Created July 27, 2015 15:17
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**

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 October 20, 2015 13:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# 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 ->

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 January 20, 2018 15:52 — forked from jbraithwaite/shipitfile.js
Shipit deploy with Slack integration
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';

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:

const Product = React.memo((props) => {
const { name, price } = props;
return (
<div className="product-info">
<span>{name}</span>
<span>{price}</span>
</div>
);
});
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() {