Skip to content

Instantly share code, notes, and snippets.

View rosdyana's full-sized avatar
💭
I may be slow to respond.

Rosdyana Kusuma rosdyana

💭
I may be slow to respond.
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:g="http://base.google.com/ns/1.0">
<title>abc : 666</title>
<link rel="self" href="https://www.abc.com.tw"/>
<entry>
<g:id>04070325</g:id>
<g:availability>available for order</g:availability>
<g:condition>refurbished</g:condition>
<g:description><![CDATA[學院風格紋綁帶毛呢後鬆緊褲裙]]></g:description>

Tata Cara Mengerjakan Tugas Wajib

Lembar Soal

  • Lembar soal dapat di unduh melalui link berikut
Nama Tugas Jurusan Semester Unduh Tugas Batas Waktu Pengumpulan
Tugas Wajib 1 PGSD Semester 3 Unduh 2 Hari setelah TUWEB 2
Tugas Wajib 1 PGPAUD Semester 2 Unduh 2 Hari setelah TUWEB 2
Tugas Wajib 1 PGPAUD Semester 9 Unduh 2 Hari setelah TUWEB 2
@rosdyana
rosdyana / PR.md
Last active April 15, 2020 02:45

Description of PR that completes issue here...

Screenshot (if available)

Changes

  • Item 1
  • Item 2
  • Item 3
@rosdyana
rosdyana / postgres-cheatsheet.md
Created April 1, 2020 08:59 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
import pandas as pd
import sys
CHUNK_SIZE = int(sys.argv[2])
rows = pd.read_csv(sys.argv[1], chunksize=CHUNK_SIZE)
for i, chuck in enumerate(rows):
# i is for chunk number of each iteration
chuck.to_csv('out{}.csv'.format(i))
# from remote to local
```
scp remote_username@10.10.0.2:/remote/file.txt /local/directory
```
# from local to remote
```
scp file.txt remote_username@10.10.0.2:/remote/directory
```
from omnidata.models import *
from ma_audience.models import *
from django.db.models import *
from omnidata.models import Product as d_Product, Organization as d_Organization, Conversion, PageView
import collections
from datetime import timedelta
org = Organization.objects.get(id=1) # Ruby
d_org = d_Organization.objects.get(id=1)
@rosdyana
rosdyana / remove_duplicates.py
Last active January 15, 2020 07:01 — forked from victorono/remove_duplicates.py
Django - remove duplicate objects where there is more than one field to compare
from django.db.models import Count, Max, Q
from django.db.models.functions import Length
from ma_audience.models import Audience
unique_fields = ['email']
duplicates = (
Audience.objects.filter(Q(organization_id=81), ~Q(email=''), Q(email__isnull=False)).values(*unique_fields)
.order_by()
.annotate(max_id=Max('id'), count_id=Count('id'))
def repeatedString(s, n):
number = s.count('a')
if number == 0:
return 0
if number == 1 and len(s) == 1:
return n
repeats = n//len(s)
remainder = math.floor(n%len(s))
return number*repeats+s[:remainder].count('a')
This file has been truncated, but you can view the full file.
{"2004": "Afghanistan", "2008": "Albania", "2010": "Antarctica", "2012": "Algeria", "2016": "American Samoa", "2020": "Andorra", "2024": "Angola", "2028": "Antigua and Barbuda", "2031": "Azerbaijan", "2032": "Argentina", "2036": "Australia", "2040": "Austria", "2044": "The Bahamas", "2048": "Bahrain", "2050": "Bangladesh", "2051": "Armenia", "2052": "Barbados", "2056": "Belgium", "2060": "Bermuda", "2064": "Bhutan", "2068": "Bolivia", "2070": "Bosnia and Herzegovina", "2072": "Botswana", "2074": "Bouvet Island", "2076": "Brazil", "2084": "Belize", "2086": "British Indian Ocean Territory", "2090": "Solomon Islands", "2092": "British Virgin Islands", "2096": "Brunei", "2100": "Bulgaria", "2104": "Myanmar (Burma)", "2108": "Burundi", "2112": "Belarus", "2116": "Cambodia", "2120": "Cameroon", "2124": "Canada", "2132": "Cape Verde", "2136": "Cayman Islands", "2140": "Central African Republic", "2144": "Sri Lanka", "2148": "Chad", "2152": "Chile", "2156": "China", "2158": "Taiwan", "2162": "Christmas Island", "2166