The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
import requests | |
key = "API_KEY_HERE" | |
def getNPR(zipcode, key): | |
url = "http://api.npr.org/stations?apiKey={0}&format=json&zip={1}".format(key, zipcode) | |
r = requests.get(url) |
To Run:
Needs to be root to create deamon, there are ways around this, but for this simple program I didn't build it it
sudo su python daemonizer.py
There wont be an output, because the program main ran in the background.
If you want to see it do something, make the my_main_loop connect to a db, and place a record in it
from decimal import * | |
import math | |
def mem_fib(n, _cache={}): | |
'''efficiently memoized recursive function, returns a Fibonacci number''' | |
if n in _cache: | |
return _cache[n] | |
elif n > 1: | |
return _cache.setdefault(n, mem_fib(n-1) + mem_fib(n-2)) | |
return n |
// ==UserScript== | |
// @name Facebook Ad Killer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Kill All the Facebook Suggested Posts | |
// @author Matthew Harris | |
// @match https://www.facebook.com/* | |
// @grant none | |
// ==/UserScript== |
import pprint | |
def CodeFight(n): | |
lst = [] | |
for x in xrange(1,n+1): | |
if x % 5 == 0: | |
o = "Code" | |
elif x % 7 == 0: | |
o = "Fight" | |
else: |
from flask import Flask | |
import sqlite3 | |
import os | |
from time import sleep | |
app = Flask(__name__) | |
def gen_test_data(): | |
## Complete rebuild the db before build | |
try: |
// Import the JS interop library | |
import 'dart:js'; | |
// export the js wrapper as the function you want, since I'm only exporting one, i used the handy => notation. | |
void main() => context['adder'] = jsAdder; | |
// This wraps adder, returning the object we created, now I made it return a map, since that's usually more useful. | |
Object jsAdder(num a,num b) { | |
return new JsObject.jsify(adder(a, b)); | |
} |
get_winner :: (Integer, Integer) -> Integer | |
get_winner (first, second) | |
| first > second = 1 | |
| first < second = -1 | |
| otherwise = 0 | |
main = do | |
print $ get_winner $ (21, 52) | |
-- main.hs:40:1: error: |
npm create vuetify
✔ Project name: … com.example.cap
✔ Which preset would you like to install? › Essentials (Vuetify, VueRouter, Pinia)
✔ Use TypeScript? … Yes
✔ Would you like to install dependencies with yarn, npm, or pnpm? › npm
... installs vue + vuetify + pinia
npm run build