Skip to content

Instantly share code, notes, and snippets.

View aputs's full-sized avatar

Allan Ralph Hutalla aputs

  • Earth
  • Philippines
View GitHub Profile
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@dvcrn
dvcrn / reagent-animated-example.cljs
Last active January 31, 2023 01:08
reagent react-native animation example
;; very simple example on how to use Animated with reagent
;; https://facebook.github.io/react-native/docs/animations.html
(def animated (.-Animated js/React))
(def animated-value (.-Value animated))
(def animated-view (r/adapt-react-class (.-View animated)))
(defn testview []
(r/create-class
@ericuldall
ericuldall / bq_audit.js
Created December 17, 2015 19:09 — forked from anonymous/bq_audit.js
An easy way to audit big query costs in node
var audit = { //configure audit settings
export: {
project_id: 'PROJECT ID TO AUDIT QUERIES FROM'
},
import: {
project_id: 'PROJECT ID TO STORE AUDIT DATA IN',
dataset_id: 'DATASET ID TO STORE AUDIT DATA IN',
table_id: 'TABLE ID TO STORE AUDIT DATA IN'
}
};
@granturing
granturing / reactive_map.js
Last active November 14, 2022 04:28
Sample reactive Leaflet code for Zeppelin
<!-- place this in an %angular paragraph -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />
<div id="map" style="height: 800px; width: 100%"></div>
<script type="text/javascript">
function initMap() {
var map = L.map('map').setView([30.00, -30.00], 3);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
@alexmcroberts
alexmcroberts / main.go
Last active February 17, 2022 11:52
Golang unmarshal JSON epoch in milliseconds from string to time.Time
package main
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
)
@andypetrella
andypetrella / TOC.cell.js
Last active October 2, 2015 18:26
Drop this cell into one of your Spark Notebook (https://github.com/andypetrella/spark-notebook/) declaring headings, execute, hide output, hide input
:javascript
require(["jquery", "underscore"], function(j, _) {
j(".toc").remove();
var toc = j(document.createElement("div"));
toc.attr("id", "toc")
.addClass("toc")
.css("position", "fixed")
.css("top", "15%")
.css("width", "8%")
.addClass("panel").addClass("panel-info");
@ogavrisevs
ogavrisevs / aws-temp-token.sh
Created July 29, 2015 16:36
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@sargunv
sargunv / AnkoSupportLibrary.kt
Last active February 13, 2017 14:10 — forked from mgranberry/DesignSupport.kt
A set of Anko-compatible extensions for Google's support libraries
import android.app.Activity
import android.support.design.widget.*
import android.support.v4.app.Fragment
import android.support.v4.view.PagerTabStrip
import android.support.v4.view.PagerTitleStrip
import android.support.v4.view.ViewPager
import android.support.v4.widget.DrawerLayout
import android.support.v4.widget.SlidingPaneLayout
import android.support.v7.widget.CardView
import android.support.v7.widget.GridLayout
(ns foobar.search
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [<! chan put!] :as a]
[reagent.core :as reagent]
[reagent.ratom :refer [atom]]))
; Source: https://gist.github.com/Deraen/946ac9e6c6211c83f1e9
(defn debounce [in ms]
"Creates a channel which will change put a new value to the output channel
@acdha
acdha / custom-log-filtering-and-formatting.py
Created February 26, 2014 21:19
Example of how to filter or apply custom formatting using Python's logging library
#!/usr/bin/env python
# encoding: utf-8
from pprint import pformat, pprint
import logging
class PasswordMaskingFilter(logging.Filter):
"""Demonstrate how to filter sensitive data:"""