Skip to content

Instantly share code, notes, and snippets.

View NaniteFactory's full-sized avatar
😊
Hi

NaniteFactory

😊
Hi
View GitHub Profile
@flaviocopes
flaviocopes / check-substring-ends-with.go
Last active October 21, 2025 08:55
Go: check if a string ends with a substring #golang
package main
import (
"strings"
)
func main() {
strings.HasSuffix("foobar", "bar") // true
}
@mattheworiordan
mattheworiordan / restart.sh
Created August 19, 2017 13:23
Heroku scheduled restarts
#!/bin/sh
# Set up the Heroku scheduler to run this command every hour. See example setup at https://goo.gl/nMCSH3
#
# Requires env vars to be set in Heroku with `heroku config:set`:
# - HEROKU_APP_NAME: this is just the app name in Heroku, i.e. `heroku apps` will list all apps you have access to
# - HEROKU_CLI_USER: Once Heroku CLI is authenticated (https://goo.gl/Qypr4x), check `cat .netrc` (or `_netrc` on Windows),
# look for `login` under `machine api.heroku.com`
# - HEROKU_CLI_TOKEN: As above, but use the `password` field
#
@Talv
Talv / list.py
Last active April 30, 2023 23:12
sc2 maps cache list
#!/usr/bin/python
import re
import glob
from mpyq import MPQArchive
# CACHE_DIR = '/home/kk/.wine/drive_c/users/Public/Application Data/Blizzard Entertainment/Battle.net/Cache'
CACHE_DIR = 'C:\ProgramData\Blizzard Entertainment\Battle.net\Cache'
class SC2Map(object):
@cuixin
cuixin / json_to_map.go
Created October 25, 2017 01:53
json to map[string]interface{} example in golang
package main
import (
"encoding/json"
"fmt"
)
func dumpMap(space string, m map[string]interface{}) {
for k, v := range m {
if mv, ok := v.(map[string]interface{}); ok {