Skip to content

Instantly share code, notes, and snippets.

View felixmc's full-sized avatar

Felix Milea-Ciobanu felixmc

  • Facebook
  • Bay Area
View GitHub Profile
#!/usr/bin/env node
const path = require('path')
const exec = require('child_process').exec
const cmd = `ag "import .* from '" -G "${process.argv[2] || 'lib/'}" --nogroup | sed -e "s/:.*from//g" -e "s/'//g" | sed "s/^\\(.*\\.js\\) \\(.*\\)$/\\1 \\2/"`
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.error('Error ocurred:', error)
} else {
@BizarroDavid
BizarroDavid / send-sms.go
Last active November 10, 2022 05:14
Sending an SMS Text Message using AWS SNS service in GoLang
//assumes you have the following environment variables setup for AWS session creation
// AWS_SDK_LOAD_CONFIG=1
// AWS_ACCESS_KEY_ID=XXXXXXXXXX
// AWS_SECRET_ACCESS_KEY=XXXXXXXX
// AWS_REGION=us-west-2( or AWS_DEFAULT_REGION=us-east-1 if you are having trouble)
package main
import (
"fmt"
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

Your First Custom Element in Five Easy Steps

npm install create-element-class --save

2. Create the element

#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/drop-down-terminal@gs-extensions.zzrough.org set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
@marcysutton
marcysutton / enzyme-test.js
Last active August 23, 2021 08:20
React A11y Testing
import {expect} from 'chai';
import App from '../app/components/App';
import a11yHelper from "./a11yHelper";
describe('Accessibility', function () {
this.timeout(10000);
it('Has no errors', function () {
let config = {};
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@yannickcr
yannickcr / Readme.md
Created September 5, 2014 11:29
jQuery 1.9.1 + Browserify

jQuery 1.9.1 + Browserify

Install jQuery 1.9.1 and Browserify-shim

npm install jquery@1.9.1 --save
npm install browserify-shim --save-dev

Add the following entries in your package.json

Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama
@felixmc
felixmc / static_page_model.php
Last active December 29, 2015 16:29
simple code igniter model for a
<?php
class Static_Page_Model extends CI_Model {
function __construct() {
// Call the Model constructor
parent::__construct();
}
public function createPage ($data) {
$data['date_created'] = date('Y-m-d H:i:s');