Skip to content

Instantly share code, notes, and snippets.

View foysalit's full-sized avatar
🎯
Focusing

Foysal Ahamed foysalit

🎯
Focusing
View GitHub Profile
@kbrandwijk
kbrandwijk / notifier.js
Created August 18, 2021 06:45
Autocode Expo Slack Notifier
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const {createHmac} = await import('crypto');
const safeCompare = require('safe-compare');
// Expo request signature check
const hmac = createHmac('sha1', process.env.SECRET_WEBHOOK_KEY);
hmac.update(Buffer.from(JSON.stringify(context.params)));
const hash = `sha1=${hmac.digest('hex')}`;
console.log('context.params', context.params)
@honkskillet
honkskillet / byte-sizetuts.md
Last active August 22, 2024 14:19
A series of golang tutorials with youtube videos.
@sean-hill
sean-hill / Ionic and ngCordova upload example
Last active May 6, 2019 01:52
Upload service for Ionic and ngCordova
Ionic and ngCordova upload example
@dergachev
dergachev / ubuntu-eol.md
Last active September 12, 2024 02:24
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@staltz
staltz / introrx.md
Last active October 17, 2024 14:12
The introduction to Reactive Programming you've been missing

My Validation Base Class

I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.

<?php

namespace FooProject\Internal\Validators;

use FooProject\Internal\Sanitizers\BaseSanitizer;
@jbenet
jbenet / simple-git-branching-model.md
Last active October 15, 2024 08:25
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@trantorLiu
trantorLiu / handlebars-pagination-helper.js
Last active August 10, 2023 14:01
Handlebars pagination helper.
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) {
var startPage, endPage, context;
if (arguments.length === 3) {
options = size;
size = 5;
}
startPage = currentPage - Math.floor(size / 2);
endPage = currentPage + Math.floor(size / 2);
@jackfranklin
jackfranklin / template.js
Created May 8, 2013 09:15
Really simple template loaded with jQuery.
var Template = function(opts) {
this.name = opts.name;
};
Template.prototype.load = function(cb) {
var self = this;
cb = cb || function() {};
var req = $.ajax({
url: "/templates/" + this.name + ".handlebars"
});