This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func calculateAge(dob : String) -> (year :Int, month : Int, day : Int){ | |
let df = NSDateFormatter() | |
df.dateFormat = "yyyy-MM-dd" | |
let date = df.dateFromString(dob) | |
guard let val = date else{ | |
return (0, 0, 0) | |
} | |
var years = 0 | |
var months = 0 | |
var days = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Split-Path -parent $dte.Solution.FileName | cd | |
New-Item -ItemType Directory -Force -Path ".\licenses" | |
@( Get-Project -All | ? { $_.ProjectName } | % { Get-Package -ProjectName $_.ProjectName } ) | Sort -Unique Id | % { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, (Join-Path (pwd) 'licenses\') + $pkg.Id + ".html") } Catch [system.exception] { Write-Host "Could not download license for $($pkg.Id)" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileDescriptor; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.PrintStream; | |
public class HelloWorld{ | |
private static HelloWorld instance; | |
public static void main(String[] args){ | |
instantiateHelloWorldMainClassAndRun(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for v in lista: | |
if lista[v] == idb: | |
lista[v] = ida | |
[a==5 and "change" or a for a in range(10)] | |
[0, 1, 2, 3, 4, 'change', 6, 7, 8, 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from libqtile.config import Key, Screen, Group | |
from libqtile.command import lazy | |
from libqtile import layout, bar, widget, hook | |
import subprocess | |
import re | |
mod = "mod4" | |
keys = [ | |
# Switch between windows in current stack pane |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sometimes you need to move your existing git repository | |
# to a new remote repository (/new remote origin). | |
# Here are a simple and quick steps that does exactly this. | |
# | |
# Let's assume we call "old repo" the repository you wish | |
# to move, and "new repo" the one you wish to move to. | |
# | |
### Step 1. Make sure you have a local copy of all "old repo" | |
### branches and tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#models.py | |
#Stdlib imports | |
import datetime | |
#Django core Imports | |
from django.db import models | |
from django.contrib.auth.models import ( | |
BaseUserManager, AbstractBaseUser, PermissionsMixin | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"1":{"Pais":"Republica Dominicana","Provincia":{"1":{"Nombre":"Distrito Nacional","Capital":"Santo Domingo de Guzmán"},"2":{"Nombre":"Azua","Capital":"Azua de Compostela","Municipio":{"1":{"Nombre":"Azua de Compostela","Distrito":{"1":"Barreras ","2":"Barro Arriba ","3":"Clavellina ","4":"Emma Balaguer Viuda Vallejo ","5":"Las Barías-La Estancia ","6":"Las Lomas ","7":"Los Jovillos ","8":"Puerto Viejo"}},"2":{"Nombre":"Estebanía"},"3":{"Nombre":"Guayabal"},"4":{"Nombre":"Las Charcas","Distrito":{"9":"Hatillo ","10":"Palmar de Ocoa"}},"5":{"Nombre":"Las Yayas de Viajama","Distrito":{"11":"Villarpando ","12":"Hato Nuevo-Cortés"}},"6":{"Nombre":"Padre Las Casas","Distrito":{"13":"La Siembra ","14":"Las Lagunas ","15":"Los Fríos"}},"7":{"Nombre":"Peralta"},"8":{"Nombre":"Pueblo Viejo","Distrito":{"16":"El Rosario"}},"9":{"Nombre":"Sabana Yegua","Distrito":{"17":"Proyecto 4 ","18":"Ganadero ","19":"Proyecto 2-C"}},"10":{"Nombre":"Tábara Arriba","Distrito":{"20":"Amiama Gómez ","21":"Los Toros ","22":"Tábara Abajo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-server | |
-Xms2048m | |
-Xmx2048m | |
-XX:NewSize=512m | |
-XX:MaxNewSize=512m | |
-XX:PermSize=512m | |
-XX:MaxPermSize=512m | |
-XX:+UseParNewGC | |
-XX:ParallelGCThreads=4 | |
-XX:MaxTenuringThreshold=1 |
NewerOlder